Optimal. Leaf size=46 \[ \frac{2 \sin (c+d x)}{a^2 d}+\frac{2 i \cos (c+d x)}{a^2 d}-\frac{\tanh ^{-1}(\sin (c+d x))}{a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11459, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.241, Rules used = {3092, 3090, 2637, 2638, 2592, 321, 206} \[ \frac{2 \sin (c+d x)}{a^2 d}+\frac{2 i \cos (c+d x)}{a^2 d}-\frac{\tanh ^{-1}(\sin (c+d x))}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3092
Rule 3090
Rule 2637
Rule 2638
Rule 2592
Rule 321
Rule 206
Rubi steps
\begin{align*} \int \frac{\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx &=-\frac{\int \sec (c+d x) (i a \cos (c+d x)+a \sin (c+d x))^2 \, dx}{a^4}\\ &=-\frac{\int \left (-a^2 \cos (c+d x)+2 i a^2 \sin (c+d x)+a^2 \sin (c+d x) \tan (c+d x)\right ) \, dx}{a^4}\\ &=-\frac{(2 i) \int \sin (c+d x) \, dx}{a^2}+\frac{\int \cos (c+d x) \, dx}{a^2}-\frac{\int \sin (c+d x) \tan (c+d x) \, dx}{a^2}\\ &=\frac{2 i \cos (c+d x)}{a^2 d}+\frac{\sin (c+d x)}{a^2 d}-\frac{\operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d}\\ &=\frac{2 i \cos (c+d x)}{a^2 d}+\frac{2 \sin (c+d x)}{a^2 d}-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d}\\ &=-\frac{\tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac{2 i \cos (c+d x)}{a^2 d}+\frac{2 \sin (c+d x)}{a^2 d}\\ \end{align*}
Mathematica [B] time = 0.230578, size = 184, normalized size = 4. \[ -\frac{\sec ^2(c+d x) \left (\cos \left (\frac{3}{2} (c+d x)\right )+i \sin \left (\frac{3}{2} (c+d x)\right )\right ) \left (\cos \left (\frac{1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )+2 i\right )+\sin \left (\frac{1}{2} (c+d x)\right ) \left (i \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )-i \log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )+2\right )\right )}{a^2 d (\tan (c+d x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.154, size = 63, normalized size = 1.4 \begin{align*} 4\,{\frac{1}{d{a}^{2} \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) }}-{\frac{1}{d{a}^{2}}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) }+{\frac{1}{d{a}^{2}}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.68299, size = 158, normalized size = 3.43 \begin{align*} -\frac{-2 i \, \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 2 i \, \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) - 4 i \, \cos \left (d x + c\right ) + \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) - 4 \, \sin \left (d x + c\right )}{2 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.482932, size = 161, normalized size = 3.5 \begin{align*} -\frac{{\left (e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.17553, size = 80, normalized size = 1.74 \begin{align*} -\frac{\frac{\log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac{\log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} - \frac{4}{a^{2}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]